<?php

namespace App\Plugin\HostServer\Models;

use App\Models\BaseModel;
use App\Plugin\HostServer\Models\HostServerBase;
use Illuminate\Database\Eloquent\Builder;

class PnHostSvDomain extends HostServerBase
{
    //


    /**
     * 写入缓存
     * @return mixed
     * @throws \Exception
     */
    public static function updateCache(){
        $nav=self::checked()->idAsc()->sortDesc()->get()->toArray();

        cache()->forever('host_server_domain',$nav);
        return $nav;
    }
    public static function domain(){
        $has=cache('host_server_domain');

        if(empty($has))
        {
            return self::updateCache();
        }

        return $has;
    }

}
